﻿using System;
using System.Data;


namespace Evaluant.Uss.Sql
{
    public class SqlMappingDataType
    {
        #region Members

        private SQLObject.SqlType _Int;
        private SQLObject.SqlType _Bool;
        private SQLObject.SqlType _Float;
        private SQLObject.SqlType _DateTime;
        private SQLObject.SqlType _Binary;
        private SQLObject.SqlType _String;

        #endregion

        #region Ctor

        public SqlMappingDataType()
        {
            // default data type mapping

            _Int = new SQLObject.SqlType(DbType.Int32.ToString());
            _Bool = new SQLObject.SqlType(DbType.Boolean.ToString());
            _Float = new SQLObject.SqlType(DbType.Double.ToString());
            _DateTime = new SQLObject.SqlType(DbType.DateTime.ToString());
            _Binary = new SQLObject.SqlType(DbType.Binary.ToString());
            _String = new SQLObject.SqlType(DbType.AnsiString.ToString(), 1024);
        }

        #endregion

        #region Properties

        public SQLObject.SqlType Int
        {
            get { return _Int; }
            set { _Int = value; }
        }

        public SQLObject.SqlType Bool
        {
            get { return _Bool; }
            set { _Bool = value; }
        }

        public SQLObject.SqlType Float
        {
            get { return _Float; }
            set { _Float = value; }
        }

        public SQLObject.SqlType DateTime
        {
            get { return _DateTime; }
            set { _DateTime = value; }
        }

        public SQLObject.SqlType Binary
        {
            get { return _Binary; }
            set { _Binary = value; }
        }

        public SQLObject.SqlType String
        {
            get { return _String; }
            set { _String = value; }
        }

        #endregion
    }
}
